<template>
  <div>
    <p v-if="flag">v-if密钥</p>
    <p v-show="flag">没有东西</p>
    <button @click="flag = !flag">显示/隐藏</button>
  </div>
</template>

<script setup>
import { ref } from "vue";
const flag = ref(true);
</script>

<style lang="scss" scoped></style>
